<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>load-file</title>
</head>
<body>
    <h1>文件异步加载</h1>
</body>
</html>

<script>
function load(src , resolve ,reject){
    let script = document.createElement('script')
    script.src = src 
    script.onload = resolve
    document.body.appendChild(script)
}

load('demo03-load-file-a.js',()=>{
    afile()
})

load('demo03-load-file-b.js',()=>{
    bfile()
})

console.log('首页任务优先执行');
</script>